<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://shiro.apache.org/tags" prefix="shiro"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta charset="utf-8">
	<title>恒铸智能柜管理平台</title>
	
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/public.css" media="all" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/resources/layui/layui.js"></script>

	<script type="text/javascript">
        layui.use(['form','layer','laydate', 'jquery'], function () {
            var form = layui.form,
                layer = parent.layer === undefined ? layui.layer : top.layer,
                $ = layui.jquery,
            	laydate = layui.laydate;


            form.on('select(test)', function (data) {
                var compId = data.value;
                // console.debug(compId)
                loadPayType(compId);
            })
            /* $("#passwordPut").hide();
             form.on('select(useType)', function (data) {
            	//快递柜
            	useType=="3"?$("#passwordPut").show():$("#passwordPut").show();
            	console.log(data)
            }) */

            function loadPayType(compId) {
                $("#payTypecase").empty();
                $.get("/caseType/getPayList", {compId: compId}, function (result) {
                    for (var i = 0; i < result.length; i++) {
                        var json = result[i];
                        $("#payTypecase").append("<option value='" + json.typeId + "'>" + json.name + "</option>")
                    }
                    form.render('select');
                })
            }
            
            var time = $("#useEndTime").val();
            laydate.render({
                elem: '#useEndTime' //指定元素
                , type: 'datetime'
                , trigger: 'click'
              	,format: 'yyyy-MM-dd HH:mm'
                , done: function (value, date, endDate) {
                    //console.log(value);
                    time = value //得到日期生成的值，如：2017-08-18
                }
            });
        })

 	</script>
</head>
<style type="text/css">
.none {
	border: 0;
	margin-top: -27px;
	margin-left: 110px;
	background-color: white !important;
}

.laytable-cell-1-10 {
	width: 200px !important;
}

.layui-form [lay-ignore] {
	color: #9f6666;
}

.special-size {
	width: 100%;
	height: 100%;
	text-align: center;
	border: 1px solid #e6e6e6;
}

.layui-form-label {
	width: 104px;
}

.demo {
	width: 188px !important;
}

.changeSize {
	color: red;
	float: right;
	margin: -40px 75px;
	width: 200px;
}

.layui-icon-refresh-3:hover {
	color: #929199;
}

.layui-table-cell .layui-form-checkbox[lay-skin="primary"] {
	top: 50%;
	transform: translateY(-50%);
}
</style>


<body class="childrenBody">
	<form id="form1" method="post" action="" class="layui-form">
		<div class="layui-form-item">
			<input type="hidden" class="layui-input caseNo none" id="caseNo"
				name="caseNo" disabled lay-verify="caseNo"></label>
		</div>
		<div class="layui-form-item">
			<input type="hidden" class="layui-input boxNumber none" disabled
				lay-verify="boxNumber"></label>
		</div>
		<div class="layui-form-item">
			<input type="hidden" class="layui-input useCase none" disabled
				lay-verify="useCase"></label>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">ID：</label>
			<div class="layui-input-inline">
				<input type="text" id="caseNo" name="caseNo"
					disabledlay-verify="caseNo" autocomplete="off"
					class="layui-input caseNo" disabled></label>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">位置：</label>
			<div class="layui-input-inline">
				<input id="place" type="text" name="place" placeholder="如：某某商场一楼  "
					autocomplete="off" class="layui-input" value="">
			</div>

		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">编号：</label>
			<div class="layui-input-inline">
				<input id="caseNoBuy" type="text" name="caseNoBuy"
					placeholder="请输入编号" autocomplete="off" class="layui-input" value="">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">备注：</label>
			<div class="layui-input-inline">
				<input id="des" type="text" name="des" placeholder="请输入备注"
					autocomplete="off" class="layui-input" value="">
			</div>
		</div>


		<div class="layui-form-item">
			<label class="layui-form-label">公司：</label>
			<div class="layui-input-inline">
				<select lay-filter="test" name="compId">
					<c:forEach items="${myCompList}" var="list">
						<option value="${list.compId }">${list.compName}</option>
					</c:forEach>
				</select>

			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">收费规则：</label>
			<div class="layui-input-inline">
				<select id="payTypecase" lay-filter="typetest" name="typeId">
					<c:forEach items="${caseTypeList}" var="list">
						<option value="${list.typeId }">${list.name}</option>
					</c:forEach>
				</select>
			</div>
		</div>
		
		<!-- 设置储物柜使用时限权限 -->
		<shiro:hasPermission name="caseUseTime:setUseEndTime">
			<div class="layui-form-item">
				<label class="layui-form-label">使用时限：</label>
				<div class="layui-input-inline">
					<input type="text" class="layui-input" id="useEndTime" name="useEndTime" autocomplete="off" placeholder="请输入选择时间">
				</div>
			</div>
		</shiro:hasPermission>
			<!-- <span id="passwordPut">
				<label class="layui-form-label">是否密码投递：</label>
				<div class="layui-input-inline">
					<input type="checkbox" name="size" value="1"
							lay-filter="passwordPut" lay-skin="switch" lay-text="是|否">
				</div>
			</span> -->
		
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">在/离线短信通知：</label>
			<div class="layui-input-inline" style="width:auto">
				<input id="isBoxOfflineNotity" type="checkbox" name="isBoxOfflineNotity" value=""
					lay-filter="isBoxOfflineNotity" lay-skin="switch" lay-text="是|否">
			</div>
			<div class="layui-inline">
				<input id="bindPhoneNumber" type="text" name="bindPhoneNumber" placeholder="请输入手机号"
					autocomplete="off" class="layui-input" value="" lay-verify="required|phone" style="width:130px">
			</div>
			<!-- <div class="layui-form-item bindPhoneNumber">
				<label class="layui-form-label"></label>
				<div class="layui-inline" >
					<input id="bindPhoneNumber" type="text" name="bindPhoneNumber" placeholder="请输入手机号"
						autocomplete="off" class="layui-input" value="" lay-verify="required|phone">
				</div> -->
		</div>
		</div>
		

		<!-- <div class="layui-form-item">
			<label class="layui-form-label">手机号：</label>
			<div class="layui-input-inline">
				<input id="des" type="text" name="des" placeholder="请输入手机号"
					autocomplete="off" class="layui-input" value="">
			</div>
		</div> -->

		<div class="layui-form-item">
			<div class="layui-input-block" style="margin-left: 135px;">
				<a class="layui-btn demo" lay-submit lay-filter="formDemo">立即提交</a>
			<input type="hidden" id="useType" value="${useType}" />
				<c:if test="${useType==7}">
					<style>
					.demo {
						width: 92px !important;
					}
					</style>
					<a class="layui-btn layui-btn-danger demo" id="price">调整价格</a>
				</c:if>
			</div>
		</div>
	</form>
	<form class="layui-form">
	<%-- <div class="layui-form-item" >
			<div class="layui-inline">
				<label class="layui-form-label">是否能中途取物:</label>
				<div class="layui-inline" id="">
					<c:if test="${isMidwayFetch == 1}">
						<input type="checkbox" name="size" value="${isMidwayFetch}" lay-filter="isMidwayFetch" lay-skin="switch" lay-text="是|否"
							checked="checked">
					</c:if>
					<c:if test="${isMidwayFetch == 0}">
						<input type="checkbox" name="size" value="${isMidwayFetch}" lay-filter="isMidwayFetch" lay-skin="switch" lay-text="是|否">
					</c:if>
				</div>
			</div> --%>
		<div class="layui-form-item changeSize">
			<label class="layui-form-label">是否能修改尺寸:</label>
			<div class="layui-input-block" id="changeisSize">
				<c:if test="${isSize==1}">
					<input type="checkbox" name="size" value="${isSize}"
						lay-filter="myisSize" lay-skin="switch" lay-text="是|否"
						checked="checked">
				</c:if>
				<c:if test="${isSize==0}">
					<input type="checkbox" name="size" value="${isSize}"
						lay-filter="myisSize" lay-skin="switch" lay-text="是|否">
				</c:if>
			</div>
		</div>
	</form>
	<i class="layui-icon layui-icon-refresh-3"
		style="font-size: 20px; color: #2d2c3b; cursor: pointer; position: fixed; top: 10px; right: 10px;"></i>
	<form class="layui-form">
		<table id="stateEdit" lay-filter="stateEdit"></table>

		<!--操作-->
		<script type="text/html" id="toolbarDemo">
        <div class="layui-btn-container">
            <a class="layui-btn layui-btn" lay-event="getCheckData">批量清除</a>
            <a class="layui-btn layui-btn" lay-event="openDoors">一键开门</a>
        </div>
    </script>
		<script type="text/html" id="stateEditBar">
        <a class="layui-btn layui-btn-xs" lay-event="open" value="{{ d.boxId }}">开门</a>
        <a class="layui-btn layui-btn-xs" lay-event="clean" value="{{ d.boxId }}">清除</a>
        <a class="layui-btn layui-btn-xs" lay-event="record" value="{{ d.boxId }}">记录</a>
    </script>

		<!-- 开关 -->
		<script type="text/html" id="isShow">
        {{#  if(d.isShow == "1"){ }}
        <input type="checkbox" name="isShow" value="{{ d.boxId }}" lay-filter="isShow" lay-skin="switch" lay-text="是|否"
               checked="checked">
        {{#  } else if(d.isShow == "0"){ }}
        <input type="checkbox" name="isShow" value="{{ d.boxId }}" lay-filter="isShow" lay-skin="switch" lay-text="是|否">
        {{#  }}}
    </script>
	</form>
</body>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/stateEdit.js"></script>

</html>